package com.ruoyi.project.system.oederteamgoods.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.system.oederteamgoods.domain.OrderTeamGoods;
import com.ruoyi.project.system.oederteamgoods.domain.OrderTeamGoodsDto;
import com.ruoyi.project.system.oederteamgoods.mapper.OrderTeamGoodsMapper;
import com.ruoyi.project.system.oederteamgoods.service.IOrderTeamGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 拼团订单商品Service业务层处理
 * 
 * @author f_baisi
 * @date 2021-03-03
 */
@Service
public class OrderTeamGoodsServiceImpl implements IOrderTeamGoodsService 
{
    @Autowired
    private OrderTeamGoodsMapper orderTeamGoodsMapper;

    /**
     * 查询拼团订单商品
     * 
     * @param id 拼团订单商品ID
     * @return 拼团订单商品
     */
    @Override
    public OrderTeamGoods selectOrderTeamGoodsById(String id)
    {
        return orderTeamGoodsMapper.selectOrderTeamGoodsById(id);
    }

    /**
     * 查询拼团订单商品列表
     * 
     * @param orderTeamGoods 拼团订单商品
     * @return 拼团订单商品
     */
    @Override
    public List<OrderTeamGoods> selectOrderTeamGoodsList(OrderTeamGoods orderTeamGoods)
    {
        return orderTeamGoodsMapper.selectOrderTeamGoodsList(orderTeamGoods);
    }

    /**
     * 新增拼团订单商品
     * 
     * @param orderTeamGoods 拼团订单商品
     * @return 结果
     */
    @Override
    public int insertOrderTeamGoods(OrderTeamGoods orderTeamGoods)
    {
        return orderTeamGoodsMapper.insertOrderTeamGoods(orderTeamGoods);
    }

    /**
     * 修改拼团订单商品
     * 
     * @param orderTeamGoods 拼团订单商品
     * @return 结果
     */
    @Override
    public int updateOrderTeamGoods(OrderTeamGoods orderTeamGoods)
    {
        return orderTeamGoodsMapper.updateOrderTeamGoods(orderTeamGoods);
    }

    /**
     * 删除拼团订单商品对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOrderTeamGoodsByIds(String ids)
    {
        return orderTeamGoodsMapper.deleteOrderTeamGoodsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除拼团订单商品信息
     * 
     * @param id 拼团订单商品ID
     * @return 结果
     */
    @Override
    public int deleteOrderTeamGoodsById(String id)
    {
        return orderTeamGoodsMapper.deleteOrderTeamGoodsById(id);
    }

    @Override
    public List<OrderTeamGoodsDto> findListByOrderId(String id) {
        return orderTeamGoodsMapper.findListByOrderId(id);
    }

    @Override
    public OrderTeamGoodsDto findByOrderId(String orderId) {
        return orderTeamGoodsMapper.findByOrderId(orderId);
    }
}
